#include"stack.hpp"
#include<iostream>

//------------------------------------------
//function about listdata     --------------
//------------------------------------------

void ListData::init()
{
    std::cin>>a;
    std::cin>>b;
}

bool ListData::operator==(ListData& comData)
{
   if(this->a==comData.a&&this->b==comData.b)
   { 
        return 1;
   }
   else {
   return 0;
   }
}

void ListData::operator=(ListData* data)
{
   this->a=data->a;
   this->b=data->b;
}


void ListData::show()
{
    std::cout<<a<<" "<<b<<"\n";
}

//------------------------------------------
//function about sequencelist --------------
//------------------------------------------

SequenceStack::SequenceStack(int size)
{ 
    data=new ListData[size];
}


int SequenceStack::IfEmpty()
{
    if(dataSize==-1)
    {
        return 1;
    }
    else
    {  
        return 0;
    }
}

int SequenceStack::GetLength()
{
    return dataSize+1;
}

ListData& SequenceStack::GetTop()
{
    return data[dataSize];
}

void SequenceStack::Clear()
{
    dataSize=-1;
}

void SequenceStack::Push(ListData& pushData)
{
    dataSize++;
    data[dataSize]=pushData;
}

void SequenceStack::Pop()
{
    dataSize--;
}

SequenceStack::~SequenceStack()
{
    delete[] data;
}